home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / printers / iprint / tstnovel.c < prev   
Text File  |  1996-07-10  |  2KB  |  29 lines

  1. /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
  2. /* Program : tstnovel.obj                                                   */
  3. /* Author  : Marc Chauffour                                                 */
  4. /* Date-written : 03/13/90 09:14am                                          */
  5. /* Last-updated :                                                           */
  6. /*                                                                          */
  7. /* Update :
  8. /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
  9. /* test si novell est charge ou non : Utilise le service 0DCh de l'interrupt*/
  10. /* DOS 21h                                                                  */
  11. /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
  12. #define NETWARE    0xDC            /* Get shell Table Adresses         */
  13.  
  14.  
  15. #include <dos.h>
  16.  
  17. int testnovell( void )            /* Test si novell est charge        */
  18. {
  19. union REGS regs;            /* definition des registres         */
  20. struct SREGS sregs;            /* Segment register                 */
  21. char work;                /* connection ID regenere           */
  22.   regs.h.ah = NETWARE;            /* fonction novell                  */
  23.   intdosx(®s,®s,&sregs);        /* interruption dos                 */
  24.   if (regs.x.cflag || regs.h.al==0) return(-1);     /* si on a des problemes   */
  25.   work=(regs.h.cl > '9' ? regs.h.cl-'A'+10:regs.h.cl-'0')*16 +
  26.        (regs.h.ch > '9' ? regs.h.ch-'A'+10:regs.h.ch-'0');
  27.   return(work==regs.h.al ? 0 : -1);
  28. }
  29.